﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace TestManagerClient
{
    /// <summary>
    /// Zbiór metod kontrolujących wyświetlanie informacji na ekranie (powiadomienia, ostrzeżenia i błędy).
    /// </summary>
    class InformationDisplay
    {
        public static void HideWarning(Grid warningGrid, TextBlock warningTextBlock)
        {
            warningGrid.Visibility = Visibility.Hidden;
            warningGrid.Height = 0;
            warningTextBlock.Text = string.Empty;
            Memory.warningShown = false;
        }

        public static void HideNotification(Grid notificationGrid, TextBlock notificationTextBlock)
        {
            notificationGrid.Visibility = Visibility.Hidden;
            notificationGrid.Height = 0;
            notificationTextBlock.Text = string.Empty;
            Memory.notificationShown = false;
        }

        public static void HideError(Grid errorGrid, TextBlock errorTextBlock)
        {
            errorGrid.Visibility = Visibility.Hidden;
            errorGrid.Height = 0;
            errorTextBlock.Text = string.Empty;
            Memory.errorShown = false;
        }

        public static void ShowWarning(string warning, Grid warningGrid, TextBlock warningTextBlock)
        {
            warningGrid.Visibility = Visibility.Visible;
            warningGrid.Height = Double.NaN;
            warningTextBlock.Text = warning;
            Memory.warningShown = true;
        }

        public static void ShowNotification(string notification, Grid notificationGrid, TextBlock notificationTextBlock)
        {
            notificationGrid.Visibility = Visibility.Visible;
            notificationGrid.Height = Double.NaN;
            notificationTextBlock.Text = notification;
            Memory.notificationShown = true;
        }

        public static void ShowError(string error, Grid errorGrid, TextBlock errorTextBlock)
        {
            errorGrid.Visibility = Visibility.Visible;
            errorGrid.Height = Double.NaN;
            errorTextBlock.Text = error;
            Memory.errorShown = true;
        }
    }
}
